import request from '@/utils/request.js'

const getArticlelListAPI = ({ channelId, timestamp = new Date() }) => {
  return request({
    url: '/v1_0/articles',
    params: {
      channel_id: channelId,
      timestamp
    },
    isAuth: false
  })
}
const ArticlesNolike = ({ artid }) => {
  return request({
    url: '/v1_0/article/dislikes',
    method: 'POST',
    data: {
      target: artid
    }
  })
}
const articleReportsAPI = ({ target, type, remark }) => {
  return request({
    url: '/v1_0/article/reports',
    method: 'POST',
    data: {
      target: target,
      type: type,
      remark: remark
    }
  })
}
export const allChannelListAPI = () => {
  return request({
    url: '/v1_0/channels'
  })
}
const updatachannelAPI = ({ channels }) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels: channels
    }
  })
}
export { getArticlelListAPI, ArticlesNolike, articleReportsAPI, updatachannelAPI }
